//
//  CLNavigationViewController.m
//  weibo-OC
//
//  Created by Oboe_b on 16/8/29.
//  Copyright © 2016年 Oboe_b. All rights reserved.
//

#import "CLNavigationViewController.h"


@interface CLNavigationViewController ()

@end

@implementation CLNavigationViewController

//+ (void)load{
//    UIBarButtonItem *item = [UIBarButtonItem appearance];
//    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
//    dict[NSFontAttributeName] = [UIFont systemFontOfSize:17];
//    dict[NSForegroundColorAttributeName] = [UIColor blackColor];
//    [item setTitleTextAttributes:dict forState:UIControlStateNormal];
//
//    UINavigationBar *bar = [UINavigationBar appearance];
//   [bar setBackgroundImage:[UIImage imageWithColor:[UIColor whiteColor]] forBarMetrics:UIBarMetricsDefault];
//    [bar setTintColor:BarColor];
//    [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
//    NSMutableDictionary *dictBar = [NSMutableDictionary dictionaryWithCapacity:1];
//    dictBar[NSFontAttributeName] = [UIFont systemFontOfSize:20];
//    dictBar[NSForegroundColorAttributeName] = [UIColor blackColor];
//    [bar setTitleTextAttributes:dictBar];
//
//    [UIBarButtonItem appearance].tintColor = [UIColor whiteColor];
//    bar.barStyle = UIBarStyleBlack;
//    bar.translucent = NO;
//}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    
    NSString *title = @"返回";
    if (self.viewControllers.count > 0) {
        if(self.viewControllers.count >= 1) {
            viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:title imageName:@"navigationbar_back_withtext" target:self action:@selector(back)];
        } else{
            viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:title imageName:@"navigationbar_back_withtext" target:self action:@selector(back)];
        }
     
    }
    [super pushViewController:viewController animated:animated];
}

- (void)back {
    [self popViewControllerAnimated:true];
}

@end
